<?php

namespace app\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\filters\VerbFilter;
use app\models\LoginForm;
use app\models\ContactForm;

class HomeController extends CController
{
    public function actionIndex()
    {
        return $this->render('index');
    }
    
    public function actionLogin()
    {
    	if(Yii::$app -> request->isPost){
    		Yii::$app->response->format = 'json';
    		
    		if($_POST["username"] == "vh" && $_POST['password'] == "pass")
    		{
    			return ["status" => "success"];
    		}
    		else 
    			return ["status" => "failure"];
    	}
    	else 
    	{
    		return $this->render('login');
    	}
    }
}
